package gui.edit.listeners;

import gui.edit.components.ActorsPanel;
import gui.edit.utils.Actor;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JPanel;

import tuio.components.CheckBoxTouch;

/**
 * @author Charles Perin
 * 29 mars 2011
 * LIMSI - INRIA Rennes
 * charles.perin@free.fr
 *
 */
public class ListenerActorsIsolate extends ListenerParamChange implements ActionListener {

	private Actor actor;
	
	public ListenerActorsIsolate(Actor actor, JPanel parent){
		super(parent);
		this.actor=actor;
	}


	@Override
	public void actionPerformed(ActionEvent e) {
		CheckBoxTouch source = (CheckBoxTouch) e.getSource();
		actor.setIsolated(source.isSelected());
		((ActorsPanel)parent).getDataControl().getParamsControl().modifyActorIsolation(actor.getName(), source.isSelected());
		((ActorsPanel)parent).updateRelationsPanel();
	}
}
